﻿@model IEnumerable<DeJC.DAL.Model.Product>

@{
    ViewBag.Title = "Index";
    Layout="~/Views/Shared/_LayoutConfig.cshtml";
    
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>Name</th>
        <th>Categoria</th>
        <th>Marca</th>
        <th>Unidad</th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>@item.Name</td>
        <td>@item.NavCategory.Name</td>
        <td>@item.NavBrand.Name</td>
        <td>@item.NavUnit.Name</td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>
